3.181 \(\int (a+a \tan ^2(c+d x))^2 \, dx\)

Optimal. Leaf size=32 \[ \frac{a^2 \tan ^3(c+d x)}{3 d}+\frac{a^2 \tan (c+d x)}{d} \]

[Out]

(a^2*Tan[c + d*x])/d + (a^2*Tan[c + d*x]^3)/(3*d)

________________________________________________________________________________________

Rubi [A]  time = 0.0250517, antiderivative size = 32, normalized size of antiderivative = 1., number of steps used = 4, number of rules used = 3, integrand size = 14, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.214, Rules used = {3657, 12, 3767} \[ \frac{a^2 \tan ^3(c+d x)}{3 d}+\frac{a^2 \tan (c+d x)}{d} \]

Antiderivative was successfully verified.

[In]

Int[(a + a*Tan[c + d*x]^2)^2,x]

[Out]

(a^2*Tan[c + d*x])/d + (a^2*Tan[c + d*x]^3)/(3*d)

Rule 3657

Int[(u_.)*((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)]^2)^(p_), x_Symbol] :> Int[ActivateTrig[u*(a*sec[e + f*x]^2)^p]
, x] /; FreeQ[{a, b, e, f, p}, x] && EqQ[a, b]

Rule 12

Int[(a_)*(u_), x_Symbol] :> Dist[a, Int[u, x], x] /; FreeQ[a, x] &&  !MatchQ[u, (b_)*(v_) /; FreeQ[b, x]]

Rule 3767

Int[csc[(c_.) + (d_.)*(x_)]^(n_), x_Symbol] :> -Dist[d^(-1), Subst[Int[ExpandIntegrand[(1 + x^2)^(n/2 - 1), x]
, x], x, Cot[c + d*x]], x] /; FreeQ[{c, d}, x] && IGtQ[n/2, 0]

Rubi steps

\begin{align*} \int \left (a+a \tan ^2(c+d x)\right )^2 \, dx &=\int a^2 \sec ^4(c+d x) \, dx\\ &=a^2 \int \sec ^4(c+d x) \, dx\\ &=-\frac{a^2 \operatorname{Subst}\left (\int \left (1+x^2\right ) \, dx,x,-\tan (c+d x)\right )}{d}\\ &=\frac{a^2 \tan (c+d x)}{d}+\frac{a^2 \tan ^3(c+d x)}{3 d}\\ \end{align*}

Mathematica [A]  time = 0.0394271, size = 26, normalized size = 0.81 \[ \frac{a^2 \left (\frac{1}{3} \tan ^3(c+d x)+\tan (c+d x)\right )}{d} \]

Antiderivative was successfully verified.

[In]

Integrate[(a + a*Tan[c + d*x]^2)^2,x]

[Out]

(a^2*(Tan[c + d*x] + Tan[c + d*x]^3/3))/d

________________________________________________________________________________________

Maple [A]  time = 0.003, size = 25, normalized size = 0.8 \begin{align*}{\frac{{a}^{2}}{d} \left ({\frac{ \left ( \tan \left ( dx+c \right ) \right ) ^{3}}{3}}+\tan \left ( dx+c \right ) \right ) } \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((a+a*tan(d*x+c)^2)^2,x)

[Out]

1/d*a^2*(1/3*tan(d*x+c)^3+tan(d*x+c))

________________________________________________________________________________________

Maxima [A]  time = 1.49551, size = 80, normalized size = 2.5 \begin{align*} a^{2} x + \frac{{\left (\tan \left (d x + c\right )^{3} + 3 \, d x + 3 \, c - 3 \, \tan \left (d x + c\right )\right )} a^{2}}{3 \, d} - \frac{2 \,{\left (d x + c - \tan \left (d x + c\right )\right )} a^{2}}{d} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+a*tan(d*x+c)^2)^2,x, algorithm="maxima")

[Out]

a^2*x + 1/3*(tan(d*x + c)^3 + 3*d*x + 3*c - 3*tan(d*x + c))*a^2/d - 2*(d*x + c - tan(d*x + c))*a^2/d

________________________________________________________________________________________

Fricas [A]  time = 0.998854, size = 66, normalized size = 2.06 \begin{align*} \frac{a^{2} \tan \left (d x + c\right )^{3} + 3 \, a^{2} \tan \left (d x + c\right )}{3 \, d} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+a*tan(d*x+c)^2)^2,x, algorithm="fricas")

[Out]

1/3*(a^2*tan(d*x + c)^3 + 3*a^2*tan(d*x + c))/d

________________________________________________________________________________________

Sympy [A]  time = 0.32683, size = 37, normalized size = 1.16 \begin{align*} \begin{cases} \frac{a^{2} \tan ^{3}{\left (c + d x \right )}}{3 d} + \frac{a^{2} \tan{\left (c + d x \right )}}{d} & \text{for}\: d \neq 0 \\x \left (a \tan ^{2}{\left (c \right )} + a\right )^{2} & \text{otherwise} \end{cases} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+a*tan(d*x+c)**2)**2,x)

[Out]

Piecewise((a**2*tan(c + d*x)**3/(3*d) + a**2*tan(c + d*x)/d, Ne(d, 0)), (x*(a*tan(c)**2 + a)**2, True))

________________________________________________________________________________________

Giac [B]  time = 1.34174, size = 180, normalized size = 5.62 \begin{align*} -\frac{3 \, a^{2} \tan \left (d x\right )^{3} \tan \left (c\right )^{2} + 3 \, a^{2} \tan \left (d x\right )^{2} \tan \left (c\right )^{3} + a^{2} \tan \left (d x\right )^{3} - 3 \, a^{2} \tan \left (d x\right )^{2} \tan \left (c\right ) - 3 \, a^{2} \tan \left (d x\right ) \tan \left (c\right )^{2} + a^{2} \tan \left (c\right )^{3} + 3 \, a^{2} \tan \left (d x\right ) + 3 \, a^{2} \tan \left (c\right )}{3 \,{\left (d \tan \left (d x\right )^{3} \tan \left (c\right )^{3} - 3 \, d \tan \left (d x\right )^{2} \tan \left (c\right )^{2} + 3 \, d \tan \left (d x\right ) \tan \left (c\right ) - d\right )}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+a*tan(d*x+c)^2)^2,x, algorithm="giac")

[Out]

-1/3*(3*a^2*tan(d*x)^3*tan(c)^2 + 3*a^2*tan(d*x)^2*tan(c)^3 + a^2*tan(d*x)^3 - 3*a^2*tan(d*x)^2*tan(c) - 3*a^2
*tan(d*x)*tan(c)^2 + a^2*tan(c)^3 + 3*a^2*tan(d*x) + 3*a^2*tan(c))/(d*tan(d*x)^3*tan(c)^3 - 3*d*tan(d*x)^2*tan
(c)^2 + 3*d*tan(d*x)*tan(c) - d)